/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Easy.table;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author DR.HUY
 */
@Entity
@Table(name = "TicketReport", catalog = "EasyTicket", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TicketReport.findAll", query = "SELECT t FROM TicketReport t"),
    @NamedQuery(name = "TicketReport.findById", query = "SELECT t FROM TicketReport t WHERE t.id = :id"),
    @NamedQuery(name = "TicketReport.findByTotal", query = "SELECT t FROM TicketReport t WHERE t.total = :total"),
    @NamedQuery(name = "TicketReport.findByDateTime", query = "SELECT t FROM TicketReport t WHERE t.dateTime = :dateTime")})
public class TicketReport implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "Total", nullable = false)
    private int total;
    @Column(name = "DateTime", length = 10)
    private String dateTime;
    @JoinColumn(name = "TicketID", referencedColumnName = "TicketID", nullable = false)
    @ManyToOne(optional = false)
    private Ticket ticket;

    public TicketReport() {
    }

    public TicketReport(Integer id) {
        this.id = id;
    }

    public TicketReport(Integer id, int total) {
        this.id = id;
        this.total = total;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public Ticket getTicket() {
        return ticket;
    }

    public void setTicket(Ticket ticket) {
        this.ticket = ticket;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TicketReport)) {
            return false;
        }
        TicketReport other = (TicketReport) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Easy.table.TicketReport[id=" + id + "]";
    }

}
